/**
  状态等常量，后台字典表不维护
 */

// 盘点计划状态
export const INVENTORY_PLAN_STATUS = {
  created: '新创建',
  confirmed: '已确认',
  issued: '已下发',
  finish: '已完成',
  unfinish: '未完成'
}
// 盘点计划状态列表
export const INVENTORY_PLAN_STATUS_LIST = Object.keys(INVENTORY_PLAN_STATUS).map(k => {
  return {
    code: k,
    text: INVENTORY_PLAN_STATUS[k]
  }
})

// 盘点任务状态
export const INVENTORY_DUTY_STATUS = {
  created: '新创建',
  doing: '执行中',
  finish: '已完成'
}
// 盘点任务状态列表
export const INVENTORY_DUTY_STATUS_LIST = Object.keys(INVENTORY_DUTY_STATUS).map(k => {
  return {
    code: k,
    text: INVENTORY_DUTY_STATUS[k]
  }
})

// 盘点任务执行状态
export const INVENTORY_EXECUTE_STATUS = {
  created: '已创建',
  doing: '执行中',
  finish: '已完成'
}
// 盘点任务执行状态列表
export const INVENTORY_EXECUTE_STATUS_LIST = Object.keys(INVENTORY_EXECUTE_STATUS).map(k => {
  return {
    code: k,
    text: INVENTORY_EXECUTE_STATUS[k]
  }
})

// 盘点任务执行结果状态
export const INVENTORY_EXECUTE_RESULT_STATUS = {
  loss: '盘亏',
  equality: '盘平',
  wait: '待盘'
}
// 盘点任务执行结果状态列表
export const INVENTORY_EXECUTE_RESULT_STATUS_LIST = Object.keys(INVENTORY_EXECUTE_RESULT_STATUS).map(k => {
  return {
    code: k,
    text: INVENTORY_EXECUTE_RESULT_STATUS[k]
  }
})

// 个人工作台的基础数据
export const AUTHORITY = {
  // 超级管理员
  admin: {
    card: ['FixedAssetStatsCard', 'LowvalueGoodsStatsCard', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      // { name: '易耗入库', icon: 'ruku', orderType: 'RukuDZKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 系统用户（科技）
  kjSystemUser: {
    card: ['FixedAssetStatsCardKJ', 'LowvalueGoodsStatsCardKJ', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 部门资产专管员（科技）
  kjDeptAssetAdmin: {
    card: ['FixedAssetStatsCardKJ', 'LowvalueGoodsStatsCardKJ', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      // { name: '易耗入库', icon: 'ruku', orderType: 'RukuDZKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 部门负责人（科技）
  kjDeptPrincipal: {
    card: ['FixedAssetStatsCardKJ', 'LowvalueGoodsStatsCardKJ', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      // { name: '易耗入库', icon: 'ruku', orderType: 'RukuDZKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 资产管理员（科技）
  kjAssetAdmin: {
    card: ['FixedAssetStatsCardKJ', 'LowvalueGoodsStatsCardKJ', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      // { name: '易耗入库', icon: 'ruku', orderType: 'RukuDZKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 综合管理部负责人（科技）
  kjAdministrationPrincipal: {
    card: ['FixedAssetStatsCardKJ', 'LowvalueGoodsStatsCardKJ', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuKJ', type: 'kj' },
      // { name: '易耗入库', icon: 'ruku', orderType: 'RukuDZKJ', type: 'kj' },
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '易耗领用', icon: 'lingyong', orderType: 'LingyongDZKJ', type: 'kj' },
      // { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboKJ', type: 'kj' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuKJ', type: 'kj' },
      { name: '更换申请', icon: 'exchange', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '报废申请', icon: 'zhuanyi', orderType: 'BaofeiKJ', type: 'kj' }
    ],
    task: [
      { name: '物资入库', orderType: 'RukuKJ', type: 'kj' },
      { name: '报废申请', orderType: 'BaofeiKJ', type: 'kj' },
      { name: '物资领用', orderType: 'LingyongKJ', type: 'kj' },
      // { name: '物资转移', orderType: 'ZhuanyiKJ', type: 'kj' },
      { name: '物资维修', orderType: 'WeixiuKJ', type: 'kj' },
      { name: '物资退库', orderType: 'TuikuKJ', type: 'kj' },
      { name: '物资更换', orderType: 'GenghuanKJ', type: 'kj' },
      { name: '物资调拨', orderType: 'DiaoboKJ', type: 'kj' }
      // { name: '易耗入库', orderType: 'RukuDZKJ', type: 'kj' },
      // { name: '易耗领用', orderType: 'LingyongDZKJ', type: 'kj' }
    ]
  },
  // 资产采购员（总行）
  slAssetBuyer: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
    ],
    task: [
      { name: '物资入库', orderType: 'RukuSL' }
    ]
  },
  // 部门资产管理员（总行）
  slDeptAssetAdmin: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '领用申请', icon: 'lingyong', orderType: 'LingyongSL', type: 'sl' },
      { name: '转移申请', icon: 'zhuanyi', orderType: 'ZhuanyiSL', type: 'sl' },
      { name: '调拨申请', icon: 'diaobo', orderType: 'DiaoboSL', type: 'sl' },
      { name: '维修申请', icon: 'weixiu', orderType: 'WeixiuSL', type: 'sl' },
      { name: '借用申请', icon: 'jieyong', orderType: 'JieyongSL', type: 'sl' },
      { name: '归还申请', icon: 'guihuan', orderType: 'GuihuanSL', type: 'sl' },
      { name: '退库申请', icon: 'tuiku', orderType: 'TuikuSL', type: 'sl' },
      { name: '报废申请', icon: 'baofei', orderType: 'BaofeiSL', type: 'sl' }
    ],
    task: [
      { name: '物资领用', orderType: 'LingyongSL', type: 'sl' },
      { name: '物资配发', orderType: 'PeifaSL', type: 'sl' },
      { name: '物资转移', orderType: 'ZhuanyiSL', type: 'sl' },
      { name: '调拨申请', orderType: 'DiaoboSL', type: 'sl' },
      { name: '物资维修', orderType: 'WeixiuSL', type: 'sl' },
      { name: '物资借用', orderType: 'JieyongSL', type: 'sl' }
    ]
  },
  // 部门资产负责人（总行）
  slDeptAssetPrincipal: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
    ],
    task: [
      { name: '物资领用', orderType: 'LingyongSL', type: 'sl' },
      { name: '物资配发', orderType: 'PeifaSL', type: 'sl' },
      { name: '消耗配发', orderType: 'PeifaXHSL', type: 'sl' },
      { name: '物资转移', orderType: 'ZhuanyiSL', type: 'sl' },
      { name: '物资维修', orderType: 'WeixiuSL', type: 'sl' },
      { name: '物资借用', orderType: 'JieyongSL', type: 'sl' },
      { name: '物资归还', orderType: 'GuihuanSL', type: 'sl' },
      { name: '物资退库', orderType: 'TuikuSL', type: 'sl' }
    ]
  },
  // 资产归口管理员（总行）
  slAssetOwnerAdmin: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
      { name: '入库申请', icon: 'ruku', orderType: 'RukuSL', type: 'sl' },
      { name: '配发申请', icon: 'peifa', orderType: 'PeifaSL', type: 'sl' },
      { name: '报废申请', icon: 'baofei', orderType: 'BaofeiSL', type: 'sl' }
    ],
    task: [
      { name: '物资领用', orderType: 'LingyongSL', type: 'sl' },
      { name: '物资入库', orderType: 'RukuSL', type: 'sl' },
      { name: '物资配发', orderType: 'PeifaSL', type: 'sl' },
      { name: '消耗配发', orderType: 'PeifaXHSL', type: 'sl' },
      { name: '物资维修', orderType: 'WeixiuSL', type: 'sl' },
      { name: '物资借用', orderType: 'JieyongSL', type: 'sl' },
      { name: '物资退库', orderType: 'TuikuSL', type: 'sl' },
      { name: '报废申请', orderType: 'BaofeiSL', type: 'sl' },
      { name: '物资归还', orderType: 'GuihuanSL', type: 'sl' },
      { name: '财管资产', orderType: 'RukuFinanceSL', type: 'sl' }
    ]
  },
  // 资产归口负责人（总行）
  slAssetOwnerPrincipal: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
    ],
    task: [
      { name: '物资入库', orderType: 'RukuSL', type: 'sl' },
      { name: '物资领用', orderType: 'LingyongSL', type: 'sl' },
      { name: '物资配发', orderType: 'PeifaSL', type: 'sl' },
      { name: '消耗配发', orderType: 'PeifaXHSL', type: 'sl' },
      { name: '物资借用', orderType: 'JieyongSL', type: 'sl' },
      { name: '物资归还', orderType: 'GuihuanSL', type: 'sl' },
      { name: '物资退库', orderType: 'TuikuSL', type: 'sl' },
      { name: '报废申请', orderType: 'BaofeiSL', type: 'sl' }
    ]
  },
  // 综合管理部审批
  slZhApproval: {
    card: ['FixedAssetStatsCardSL', 'LowvalueGoodsStatsCardSL', 'MeWorkorderStatsCard', 'TodoWorkorderStatsCard', 'DoneWorkorderStatsCard'],
    quickEntry: [
    ],
    task: [
      { name: '物资入库', orderType: 'RukuSL', type: 'sl' },
      { name: '物资领用', orderType: 'LingyongSL', type: 'sl' },
      { name: '物资配发', orderType: 'PeifaSL', type: 'sl' },
      { name: '物资借用', orderType: 'JieyongSL', type: 'sl' },
      { name: '物资归还', orderType: 'GuihuanSL', type: 'sl' },
      { name: '物资维修', orderType: 'WeixiuSL', type: 'sl' },
      { name: '物资退库', orderType: 'TuikuSL', type: 'sl' },
      { name: '报废申请', orderType: 'BaofeiSL', type: 'sl' },
      { name: '调拨申请', orderType: 'DiaoboSL', type: 'sl' },
      { name: '物资转移', orderType: 'ZhuanyiSL', type: 'sl' }
    ]
  }
}

// 资产状态
export const ASSET_STATUS_MAP = {
  unused: '库存',
  used: '正常使用',
  toScrap: '待报废',
  scrap: '已报废',
  unmaintenance: '待维修',
  transfer: '转移中',
  borrow: '借用中',
  loss: '丢失',
  idle: '闲置'
}

// 资产状态
export const ASSET_STATUS = Object.keys(ASSET_STATUS_MAP).map(k => {
  return {
    code: k,
    name: ASSET_STATUS_MAP[k]
  }
})

// 盘点方式
export const INVENTORY_DUTY_TYPE = {
  department: '按部门'
  // location: '按位置'
}

// 盘点方式
export const INVENTORY_DUTY_TYPE_LIST = Object.keys(INVENTORY_DUTY_TYPE).map(k => {
  return {
    code: k,
    text: INVENTORY_DUTY_TYPE[k]
  }
})

// 合同类型
export const CONTRACT_TYPE = {
  purchase: '资产采购合同',
  sporadic: '小额零星采购合同',
  xh: '消耗品合同'
}

export const CONTRACT_TYPE_LIST = Object.keys(CONTRACT_TYPE).map(k => {
  return {
    code: k,
    text: CONTRACT_TYPE[k]
  }
})

export const SL_ROLES = {
  slAssetBuyer: '资产采购员',
  slDeptAssetAdmin: '部门资产管理员',
  slDeptAssetPrincipal: '部门资产负责人',
  slAssetOwnerAdmin: '资产归口管理员',
  slAssetOwnerPrincipal: '资产归口负责人',
  slTemp: '总行临时角色'
}

